﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="SearchLog.aspx.cs" Inherits="Workflow.Project.SearchLog" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <title></title>
    <link rel="stylesheet" type="text/css" href="../Css/bootstrap.css" />
    <link rel="stylesheet" type="text/css" href="../Css/bootstrap-responsive.css" />
    <link rel="stylesheet" type="text/css" href="../Css/style.css" />
    <script type="text/javascript" src="../Js/jquery.js"></script>
    <script type="text/javascript" src="../Js/jquery.sorted.js"></script>
    <script type="text/javascript" src="../Js/bootstrap.js"></script>
    <script type="text/javascript" src="../Js/ckform.js"></script>
    <script type="text/javascript" src="../Js/common.js"></script>

    <script type="text/javascript" src="../Scripts/MyJquery.js"></script>
    <script type="text/javascript" src="../Scripts/jquery.js"></script>
    <script type="text/javascript" src="../Scripts/jquery.pagination.js"></script>
    <script type="text/javascript" src="../Scripts/Pageination.js"></script>
    <style type="text/css">
        body {
            padding-bottom: 40px;
        }
        .sidebar-nav {
            padding: 9px 0;
        }

        @media (max-width: 980px) {
            /* Enable use of floated navbar text */
            .navbar-text.pull-right {
                float: none;
                padding-left: 5px;
                padding-right: 5px;
            }
        }


        .auto-style1 {
            width: 230px;
        }


    </style>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <table class="table table-bordered definewidth m10">
            <thead>
                <tr>
                    <th>模具号</th>
                    <th>阶段</th>
                    <th>项目活动或问题</th>
                    <th>状态</th>
                    <th>活动发生时间</th>
                    <th>规定完成时间</th>
                    <th>最终完成时间</th>
                    <th>责任部门</th>
                    <th>责任人</th>
                </tr>               
            </thead>
            <tbody id="Searchresult">
                 <% for (int i = 0; i < resultList.Count; i++) { %>
                <tr class="result">
                    <td><% =resultList[i].PJId %></td>
                    <td><% =resultList[i].Stage %></td>
                    <td><% =resultList[i].Problem %></td>
                    <td><% =resultList[i].Statues1 %></td>
                    <td><% =resultList[i].StrStartDate %></td>
                    <td id="t1<%=i %>"><label id="l1end<%=i %>" class="date"><% =resultList[i].StrCompleteDate %></label></td>
                    <td id="t2<%=i %>"><label id="l1realend<%=i %>" class="date"><% =resultList[i].StrRealCompleteDate %></label></td>
                    <td><% =resultList[i].Department %></td>
                    <td><% =resultList[i].Person %></td>
                </tr>
                <% }%>
            </tbody>
         </table>
         <%--<div id="Pagination" class="pagination definewidth m10"></div>--%>
    </div>
    </form>
    <script type="text/javascript">
        $(document).ready(function () {
            List();
            function List() {
                var count = "<% =resultList.Count%>";
                for (var i = 0; i < count; i++) {
                    ShowColor("#l1end", "#l1realend", "#t2", i);
                }
            }
            function ShowColor(str1, str2, str3, i) {
                var date1 = new Date($(str1 + i).text());
                var date2 = new Date($(str2 + i).text());
                var today = Date.now();
                var now = new Date();
                var tomorrow = now.setDate(now.getDate() + 15);
                if (date1 >= date2) {
                    $(str3 + i).attr("class", "blueColor");
                }
                else if (date1 < date2) {
                    $(str3 + i).attr("class", "grayColor");
                }
                else if ($(str2 + i).text() == "" && date1 < today) {
                    $(str3 + i).attr("class", "redColor");
                }
                else if ($(str2 + i).text() == "" && date1 <= tomorrow) {
                    $(str3 + i).attr("class", "yellowColor");
                }
            }
        });

    </script>
</body>
</html>
